package com.example.poverty.service.impl;


import com.example.poverty.dao.MemberMapper;
import com.example.poverty.entity.Member;
import com.example.poverty.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 前端  成员管理  接口实现
 */
@Service
public class MemberServiceImpl implements MemberService {

    @Autowired
    private MemberMapper memberMapper;

    @Override
    public boolean insert(Member member) {
        return memberMapper.insert(member) > 0;
    }

    @Override
    public boolean update(Member member) {
        return memberMapper.update(member) > 0;
    }

    @Override
    public boolean delete(Integer id) {
        return memberMapper.delete(id) > 0;
    }

    @Override
    public Member selectByPrimaryKey(Integer id) {
        return memberMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Member> allMember() {
        return memberMapper.allMember();
    }

    @Override
    public Member getByName(String name) {
        return memberMapper.getByName(name);
    }

    @Override
    public List<Member> memberOfOrganizationId(Integer organizationId) {
        return memberMapper.memberOfOrganizationId(organizationId);
    }
}
